package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CommodityUnitManagementMapper;
import com.ruoyi.system.domain.CommodityUnitManagement;
import com.ruoyi.system.service.ICommodityUnitManagementService;

/**
 * 商品单位管理 Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-28
 */
@Service
public class CommodityUnitManagementServiceImpl implements ICommodityUnitManagementService
{
    @Autowired
    private CommodityUnitManagementMapper commodityUnitManagementMapper;

    /**
     * 通过id查询商品单位管理
     *
     * @param id 商品单位管理主键
     * @return 商品单位管理
     */
    @Override
    public CommodityUnitManagement selectCommodityUnitManagementById(Long id)
    {
        return commodityUnitManagementMapper.selectCommodityUnitManagementById(id);
    }

    /**
     * 查询商品单位管理列表
     *
     * @param commodityUnitManagement 商品单位管理
     * @return 商品单位管理
     */
    @Override
    public List<CommodityUnitManagement> selectCommodityUnitManagementList(CommodityUnitManagement commodityUnitManagement)
    {
        return commodityUnitManagementMapper.selectCommodityUnitManagementList(commodityUnitManagement);
    }

    /**
     * 新增商品单位管理
     *
     * @param commodityUnitManagement 商品单位管理
     * @return 结果
     */
    @Override
    public int insertCommodityUnitManagement(CommodityUnitManagement commodityUnitManagement)
    {
        return commodityUnitManagementMapper.insertCommodityUnitManagement(commodityUnitManagement);
    }

    /**
     * 修改商品单位管理
     *
     * @param commodityUnitManagement 商品单位管理
     * @return 结果
     */
    @Override
    public int updateCommodityUnitManagement(CommodityUnitManagement commodityUnitManagement)
    {
        return commodityUnitManagementMapper.updateCommodityUnitManagement(commodityUnitManagement);
    }

    /**
     * 批量删除商品单位管理
     *
     * @param ids 需要删除的商品单位管理主键
     * @return 结果
     */
    @Override
    public int deleteCommodityUnitManagementByIds(Long[] ids)
    {
        return commodityUnitManagementMapper.deleteCommodityUnitManagementByIds(ids);
    }

    /**
     * 删除商品单位管理信息
     *
     * @param id 商品单位管理主键
     * @return 结果
     */
    @Override
    public int deleteCommodityUnitManagementById(Long id)
    {
        return commodityUnitManagementMapper.deleteCommodityUnitManagementById(id);
    }
}
